﻿<Window x:Class="StarTrekFileBrowser.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:my="clr-namespace:StarTrekFileBrowser"
        Title="Touch File Explorer" Height="768" Width="1024"
        x:Name="TheWindow"
        Background="Black"
        >
    <Grid x:Name="mainGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="85" />
            <RowDefinition Name="MainContentRowGrid" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="75" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Canvas Background="{Binding ElementName=TheWindow, Path=LeftSideColor, Mode=OneWay}" Width="75" Grid.Column="0" Grid.Row="1" />

        <StackPanel Orientation="Vertical">
            <Path Fill="{Binding ElementName=TheWindow, Path=LeftSideColor, Mode=OneWay}" Height="75" Width="75" Grid.Row="0" Grid.Column="0">
                <Path.Data>
                    <PathGeometry>
                        <PathFigure StartPoint="0,75" IsFilled="True" IsClosed="True">
                            <LineSegment Point="0,70" />
                            <BezierSegment Point1="0,70" Point2="0,0" Point3="70,0" />
                            <LineSegment Point="75,0" />
                            <LineSegment Point="75,75" />
                            <LineSegment Point="0,75" />
                        </PathFigure>
                    </PathGeometry>
                </Path.Data>
            </Path>
            <Canvas Height="10" Width="75" Background="{Binding ElementName=TheWindow, Path=LeftSideColor, Mode=OneWay}" />
        </StackPanel>
        
        <Grid Grid.Column="1" Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="20" />
                <ColumnDefinition />
                <ColumnDefinition Width="45" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="65" />
                <RowDefinition Height="20" />
            </Grid.RowDefinitions>
            <Path Fill="{Binding ElementName=TheWindow, Path=LeftSideColor, Mode=OneWay}" Grid.Column="0" Grid.Row="1">
                <Path.Data>
                    <PathGeometry>
                        <PathFigure StartPoint="0,0" IsFilled="True" IsClosed="True">
                            <LineSegment Point="20,0" />
                            <BezierSegment Point1="20,0" Point2="0,0" Point3="0,20" />
                            <LineSegment Point="0,0" />
                        </PathFigure>
                    </PathGeometry>
                </Path.Data>
            </Path>

            <Canvas Background="{Binding ElementName=TheWindow, Path=LeftSideColor, Mode=OneWay}" Height="65" Width="20"  Grid.Column="0" Grid.Row="0" />

            <Canvas Background="LightSkyBlue" Height="65" Grid.Column="1" Grid.Row="0" >
                <Label Name="actualPathLabel" Foreground="Black" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10,10,0,0" Height="30" FontSize="16" FontWeight="Bold" Content="{Binding ElementName=TheWindow, Path=CurrentPath, Mode=OneWay}" />
            </Canvas>

            <Path Fill="{Binding ElementName=TheWindow, Path=LeftSideColor, Mode=OneWay}" VerticalAlignment="Top" Grid.Column="2" Grid.Row="0">
                <Path.Data>
                    <PathGeometry>
                        <PathFigure StartPoint="0,0" IsFilled="True" IsClosed="True">
                            <BezierSegment Point1="0,0" Point2="32.5,0" Point3="32.5,32.5" />
                            <BezierSegment Point1="32.5,32.5" Point2="32.5,65" Point3="0,65" />
                            <LineSegment Point="0,0" />
                        </PathFigure>
                        
                    </PathGeometry>
                </Path.Data>
            </Path>
        </Grid>
        
        
        
        
        <Grid Grid.Row="1" Grid.Column="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="320" Name="leftFileGrid" />
                <ColumnDefinition Width="324" Name="middleFileGrid" />
                <ColumnDefinition Name="InformationColGrid" />
            </Grid.ColumnDefinitions>


            <ScrollViewer x:Name="items1ScrollView" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Top" 
                          HorizontalAlignment="Left" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"
                          PreviewMouseLeftButtonDown="items1ScrollView_MouseLeftButtonDown"
                          PreviewMouseLeftButtonUp="items1ScrollView_MouseLeftButtonUp"
                          TouchDown="items1ScrollView_TouchDown"
                          TouchUp="items1ScrollView_TouchDup"
                          Height="{Binding ElementName=TheWindow, Path=MainContentRowGrid, Mode=OneWay}" 
                          Width="310"
                          >
                <ItemsControl x:Name="items1" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <my:BrowserFileControl FrontLineColor="{Binding FrontLineColor}" 
                                                   Layer="{Binding Layer}" NodeID="{Binding ID}" StrokeColor="{Binding StrokeColor}" 
                                                   FillColor="{Binding FillColor}" LabelText="{Binding Filename}"  
                                                   MouseLeftButtonUp="BrowserFileControl_MouseLeftButtonUp" 
                                                   MouseLeftButtonDown="BrowserFileControl_MouseLeftButtonDown" 
                                                   TouchDown="BrowserFileControl_TouchDown"
                                                   TouchUp="BrowserFileControl_TouchUp"
                                                   Margin="0,2,0,2" />
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </ScrollViewer>

            <Canvas x:Name="connectLineCanvas" Background="Yellow" Height="0" Width="4" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,35,0,0" />
            <ScrollViewer x:Name="items2ScrollView" Grid.Column="1" Margin="4,10,0,0" 
                          VerticalAlignment="Top" HorizontalAlignment="Left" 
                          HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"
                          PreviewMouseLeftButtonUp="items2ScrollView_MouseLeftButtonUp"
                          PreviewMouseLeftButtonDown="items2ScrollView_MouseLeftButtonDown"
                          TouchDown="items2ScrollView_TouchDown"
                          TouchUp="items2ScrollView_TouchUp"
                          Height="{Binding ElementName=TheWindow, Path=ActualHeight, Mode=OneWay}" 
                          Width="310"
                          >
                
                <ItemsControl x:Name="items2" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Left" >
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <my:BrowserFileControl FrontLineColor="{Binding FrontLineColor}" Layer="{Binding Layer}" 
                                                   NodeID="{Binding ID}" StrokeColor="{Binding StrokeColor}" FillColor="{Binding FillColor}" 
                                                   LabelText="{Binding Filename}"  
                                                   MouseLeftButtonUp="BrowserFileControl_MouseLeftButtonUp" 
                                                   MouseLeftButtonDown="BrowserFileControl_MouseLeftButtonDown" 
                                                   TouchDown="BrowserFileControl_TouchDown"
                                                   TouchUp="BrowserFileControl_TouchUp"
                                                   Margin="0,2,0,2"/>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
                
            </ScrollViewer>



            <my:ContentUC Margin="5" Grid.Column="2" x:Name="ContentInformation" Visibility="Hidden" />
                        
        </Grid>
        
    </Grid>

</Window>
